package com.base.controller;

import java.util.List;

import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.base.entity.Teacher;
import com.utils.UUIDUtil;
import com.base.entity.FormatResult;
import com.base.service.BaseService;

@Controller
public class TestController {
	
	@Autowired
	private BaseService baseService;
	
	@RequestMapping("a")
	public String test1() {
		System.out.println("访问路径 a....");
		return "testJsp";
	}
	@RequestMapping("b")
	@ResponseBody
	public FormatResult test2() {
		System.out.println("访问路径 b.....");
		List<Teacher> list1 = baseService.teacherInfo();
//		UUIDUtil.createUUID();
		FormatResult formatResult = new FormatResult();
		formatResult.setCode(0);
		formatResult.setMsg("success");
		formatResult.setData(list1);		
		return formatResult;
	}
}
